<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'', styles:'bootstrap,font-awesome,animate,style,bootstrap-table,layui-date'}){}%>
</head>

<body>

<div class="wrapper wrapper-content">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox-content" style="padding:15px 20px 0px 20px;">
				<form id="search-form" role="form" class="form-horizontal">
					<div class="form-group">
						<label class="control-label col-xs-1">柜号:</label>
						<div class="col-xs-3">
							<input type="text" id="createPlanNo" name="createPlanNo"   class="form-control">
						</div>
						<label class="control-label col-xs-1">状态:</label>
						<div class="col-xs-3">
							<select id="cou" name="cou"  class="form-control">
								<option value="">请选择</option>
								<option value="0">未提交退税资料</option>
								<option value="1">已提交退税资料</option>
							</select>
						</div>

						<a class="search-btn btn btn-success" style="margin-bottom: 0px;">查询</a>
					</div>
				</form>
			</div>
			<!-- START 数据表格 -->
			<table id="dealTable"
				   data-toolbar="#toolbar"
				   data-side-pagination="server"
				   data-pagination="true"
				   data-resizable="true"
				   data-side-pagination="server"
				   data-url="/sea/physical/refusedTax/findRefusedPlan.do"
				   data-page-size="15">
			</table>
			<!-- END 数据表格 -->

			<!-- END 右侧数据 -->
		</div>
	</div>
</div>
<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,bootstrap-table,bootstrap-table-zh-CN,layer,laydate'}){}%>
<script>
    var $dealTable = $('#dealTable'),selections=[];

	laydate.render({
		elem: '#recordOperateDate',
		type: 'date',
		trigger: 'click', //修改触发方式
		format: 'yyyy-MM-dd'
	});
    $(function(){

        //START 表格配置
        $dealTable.bootstrapTable({
            height: getHeight(),
            columns: [
                {
                    title: '柜号',
                    field: 'createPlanNo',
                    align: 'left',
                    valign: 'middle'
                },{
					title: '装柜日期',
					field: 'createPlanPlaceDate',
					align: 'left',
					valign: 'middle'
				},
				{
					title: '状态',
					field: 'createPlanStatus',
					align: 'left',
					valign: 'middle',
					formatter:function (v,r) {
						var result='';
						switch (v) {
							case 1:
								result='未处理';
								break;
							case 2:
								result='已分配';
								break;
							case 3:
								result='已发运';
								break;
							case 4:
								result='已开船';
								break;
							case 5:
								result='已清关';
								break;
							case 6:
								result='已送货';
								break;
							case 7:
								result='已入库';
								break;
							default:
								result='';
						}
						return result;
					}
				},
				{
					title: '状态',
					field: 'flag',
					align: 'left',
					valign: 'middle',
					formatter:function (v, r) {
						if(v==0){
							return '未提交退税资料'
						}
						else if(v==1){
							return '已提交退税资料';
						}else {
							return '未知';
						}
					}
				}
            ],
            onLoadSuccess : function() {

            }
        });
        //END 表格配置

        //表格高度自适应
        $(window).resize(function () {
            $dealTable.bootstrapTable('resetView', {
                height: getHeight()
            });
        });
    });


    //表格高度计算
    function getHeight() {
        return $(window).height() - $('.btn-group').outerHeight(true) - $('.breadcrumb').outerHeight(true)-60;
    }

	// 条件查询
	$('.search-btn').on('click',function () {
		$dealTable.bootstrapTable('refresh', { url:'${ctxPath}/sea/physical/refusedTax/findRefusedPlan.do?'+$('#search-form').serialize() });
	});


</script>
</body>
</html>
